﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HoldemView
{
    public partial class ActionPanel : Panel
    {
        public HoldemTableDirector Director;

        public void UpdateAction()
        {
            this.btnCall.Enabled = Director.CanCall();
            this.btnFold.Enabled = Director.CanFold();
            this.btnRaise.Enabled = Director.CanRaise();

            this.rtInfo.Text = Director.ActionMessage;
        }
  
        void btnFold_Click(object sender, EventArgs e)
        {
            Director.Fold();
        }

        void btnCall_Click(object sender, EventArgs e)
        {
            Director.Call();
        }

        void btnRaise_Click(object sender, EventArgs e)
        {
            Director.Raise();
        }


        public ActionPanel(HoldemTableDirector dir)
        {
            Director = dir;
            InitializeComponent();
            this.btnRaise.Click += new EventHandler(btnRaise_Click);
            this.btnCall.Click += new EventHandler(btnCall_Click);
            this.btnFold.Click += new EventHandler(btnFold_Click);
        }
    }
}
